package lanqiao;
/**
 * @Project : ProgrammingExercises
 * @Package : LanQiao.PrepareForCompetition
 * @File : Q0176.java
 * @Author : WangRuoyu
 * @Date : 2023/3/18 9:46
 */

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Q0176 {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] words = br.readLine().split(" ");

        int x = Integer.parseInt(words[0]);
        int y = Integer.parseInt(words[1]);
        long res = 0;

        int xcount = 0;
        int ycount = 0;
        if (Math.abs(x) > Math.abs(y)) {
            if (x < 0) {
                xcount = (-x << 1) - 1;
                ycount = xcount - 1;
                int yy = x + 1;
                res = ((long) (1 + xcount) * xcount >> 1) + ((long) (1 + ycount) * ycount >> 1) + y - yy;
                System.out.println(res);
            } else {
                xcount = x << 1;
                ycount = xcount - 1;
                int yy = x;
                res = ((long) (1 + xcount) * xcount >> 1) + ((long) (1 + ycount) * ycount >> 1) + yy - y;
                System.out.println(res);
            }
        } else if (Math.abs(x) < Math.abs(y)) {
            if (y < 0) {
                ycount = (-y << 1);
            } else {
                ycount = (y << 1) - 1;
            }
            xcount = ycount;
            int xx = -y;
            res = ((long) (1 + xcount) * xcount >> 1) + ((long) (1 + ycount) * ycount >> 1) + Math.abs(xx - x);
            System.out.println(res);
        } else {
            if (x * y >= 0) {
                System.out.println((x + y) * (x + y));
            } else {
                System.out.println((x - y) * (x - y) + 2 * x);
            }
        }
    }
}
